package com.example.qxfw.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.List;

import com.example.qxfw.common.entity.qx.TownshipForecast;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

/************************************
 *
 * @author : HuangDeYin Jolly
 * @since : JDK 11
 * @Date : 2023/7/24  星期一   9:02
 * @description : 此类用来
 ***************************************/
@Mapper
@Service("qx")
public interface TownshipForecastMapperXml extends BaseMapper<TownshipForecast> {
    /**
     * delete by primary key
     *
     * @param stationid primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(@Param("stationid") String stationid, @Param("datechar") LocalDateTime datechar, @Param("timechar") String timechar, @Param("ntimes") Integer ntimes);

    /**
     * insert record to table
     *
     * @param record the record
     * @return insert count
     */
    int insert(TownshipForecast record);

    /**
     * insert record to table selective
     *
     * @param record the record
     * @return insert count
     */
    int insertSelective(TownshipForecast record);

    /**
     * select by primary key
     *
     * @param stationid primary key
     * @return object by primary key
     */
    TownshipForecast selectByPrimaryKey(@Param("stationid") String stationid, @Param("datechar") LocalDateTime datechar, @Param("timechar") String timechar, @Param("ntimes") Integer ntimes);

    /**
     * update record selective
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(TownshipForecast record);

    /**
     * update record
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(TownshipForecast record);

    List<TownshipForecast> initializationList(@Param("dateChar") String dateChar, @Param("timeChar") String timeChar, @Param("NTimes12") Integer NTimes12, @Param("NTimes24") Integer NTimes24, @Param("stationIdList") List<String> stationIdList);

    /************************
     * @Author : HuangDeYin Jolly
     * @Description :查询最高温度，用于病虫害预报
     * @return java.lang.String :
     ************************/
    List<TownshipForecast> queryMaxTemp(@Param("dateChar") Timestamp dateChar, @Param("stationId") String stationId);

    /************************
     * @Author : HuangDeYin Jolly
     * @Description :查询平局湿度
     * @return java.lang.String :
     ************************/
    List<TownshipForecast> queryHumId(@Param("dateChar") Timestamp dateChar, @Param("stationId") String stationId, @Param("maxTemp") String maxTemp, @Param("minTemp") String minTemp);


}